<template>
    <Table :columns="columns" :data="value">
        <template slot-scope="{ row, index }" slot="type">
            {{row.type === 0 ? '增加库存' : '核销库存'}}
        </template>
    </Table>
</template>

<script>
    export default {
        name: "stockView",
        props: {
            value: {
                type: Array,
                default: () => []
            }
        },
        data(){
            return {
                columns: [{
                    title: '序号',
                    width: 80,
                    render: (h, {row, column, index}) => {
                        return h('div', index + 1);
                    }
                }, {
                    title: '类型',
                    slot: 'type'
                }, {
                    title: '数量',
                    key: 'stock'
                }, {
                    title: '备注',
                    key: 'remark'
                }, {
                    title: '操作时间',
                    key: 'created_at'
                }]
            }
        }
    }
</script>

<style scoped>

</style>
